import { getMenu, getUserInfo, getGroupMenu } from '../service/getData'
import { GET_MENU, GET_USERINFO, GET_GROUP_MENU } from './mutation-types'
export default {
  async getMenu ({commit, state}, curMenu) {
    let res = await getMenu()
    commit(GET_MENU, {menu: res.data.data, curMenu: curMenu})
    return res
  },
  async getGroupMenu ({commit, state}) {
    let res = await getGroupMenu()
    commit(GET_GROUP_MENU, res.data.data)
  },
  async getUserInfo ({commit, state}) {
    let res = await getUserInfo()
    commit(GET_USERINFO, res.data.data)
    return res
  }
}
